<?php

 use yii\helpers\Html;
?>
<?=Html::jsFile('https://libs.baidu.com/jquery/2.0.0/jquery.min.js')?>
<?=Html::jsFile('js/bootstrap.min.js')?>
<?=Html::jsFile(' http://code.jquery.com/jquery-2.1.1.min.js')?>
<div class="xs">
    <div class="one">
        <input type="search" class="form-control" style="position: absolute;top: 7%;right: 17%;width: 50%;">
        <input type="submit" name="search" value="搜索" class="btn btn-success"style="position: absolute;top: 7%;right: 17%;width: 5%;">
    </div>
    <div style="margin-top: 20%;">
        <ul class="nav nav-tabs">
            <li role="presentation" class="active"><a href="#menu1" data-toggle="tab">10:00秒杀</a></li>
            <li role="presentation"><a href="#menu2" data-toggle="tab">12:00秒杀</a></li>
            <li role="presentation"><a href="#menu3" data-toggle="tab">14:00秒杀</a></li>
            <li role="presentation"><a href="#menu4" data-toggle="tab">16:00秒杀</a></li>
            <li role="presentation"><a href="#menu5" data-toggle="tab">18:00秒杀</a></li>
        </ul>
        <div class="tab-content">
            <div id="menu1" class="container tab-pane active">
                11
            </div>
            <div id="menu2" class="container tab-pane ">
                22
            </div>
            <div id="menu3" class="container tab-pane fade">
                33
            </div><div id="menu4" class="container tab-pane fade">
                44
            </div><div id="menu5" class="container tab-pane fade">
                55
            </div>
        </div>
    </div>



    <a id="sendsms" href="javascript:void(0)">发送短信</a>
</div>
<script>
    var time = 60;
    $(function(){
        $("#sendsms").click(function (){
            if(time==60){//如果不加入该判断，则会出现在倒计时期间不断的点击发生不断的加快（其实就是你点了多少次就重复多少次该函数）的问题，用setTimeout（）方法不加此判断也是一样的
                var time1=setInterval(function(){
                    if(time==0){
                        $("#sendsms").html("重新发送");
                        $("#sendsms").removeAttr("disabled");
                        time=60;
                        clearInterval(time1);
                    }else{
                        $("#sendsms").attr("disabled","true");
                        $("#sendsms").html("重新发送("+time+")");
                        time--;
                    }
                }, 1000);
            }

        })
    })
</script>

